<!--
Copyright 2017 The Kubernetes Authors.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<kd-resource-card object-meta="::$ctrl.persistentVolumeClaim.objectMeta"
                  type-meta="::$ctrl.persistentVolumeClaim.typeMeta">
  <kd-resource-card-status layout="row">
    <md-icon class="material-icons kd-error"
             ng-if="::$ctrl.isLost()">
      error
      <md-tooltip md-delay="500"
                  md-autohide>
        [[This claim is in lost state|Tooltip text which appears on error icon hover.]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons"
             ng-if="::$ctrl.isPending()">
      timelapse
      <md-tooltip md-delay="500"
                  md-autohide>
        [[This claim is in pending state|Tooltip text which appears on pending icon hover.]]
      </md-tooltip>
    </md-icon>
    <md-icon class="material-icons kd-success"
             ng-if="::$ctrl.isBound()">
      check_circle
    </md-icon>
  </kd-resource-card-status>
  <kd-resource-card-columns>
    <kd-resource-card-column>
      <div>
        <a ng-href="{{::$ctrl.getPersistentVolumeClaimDetailHref()}}"
           class="kd-middle-ellipsised-link">
          <kd-middle-ellipsis display-string="{{::$ctrl.persistentVolumeClaim.objectMeta.name}}">
          </kd-middle-ellipsis>
        </a>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column ng-if="$ctrl.areMultipleNamespacesSelected()">
      <div>
        <kd-middle-ellipsis display-string="{{::$ctrl.persistentVolumeClaim.objectMeta.namespace}}">
        </kd-middle-ellipsis>
      </div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-show="::$ctrl.persistentVolumeClaim.status">{{::$ctrl.persistentVolumeClaim.status}}</div>
      <div ng-hide="::$ctrl.persistentVolumeClaim.status">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-show="::$ctrl.persistentVolumeClaim.volume">{{::$ctrl.persistentVolumeClaim.volume}}</div>
      <div ng-hide="::$ctrl.persistentVolumeClaim.volume">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolumeClaim.capacity"
                          display-string="{{::value}}">
      </kd-middle-ellipsis>
      <div ng-hide="::$ctrl.persistentVolumeClaim.capacity">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <kd-middle-ellipsis ng-repeat="(key, value) in ::$ctrl.persistentVolumeClaim.accessModes"
                          display-string="{{::value}}">
      </kd-middle-ellipsis>
      <div ng-hide="::$ctrl.persistentVolumeClaim.accessModes">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      <div ng-show="::$ctrl.persistentVolumeClaim.storageClass">{{::$ctrl.persistentVolumeClaim.storageClass}}</div>
      <div ng-hide="::$ctrl.persistentVolumeClaim.storageClass">-</div>
    </kd-resource-card-column>
    <kd-resource-card-column>
      {{::$ctrl.persistentVolumeClaim.objectMeta.creationTimestamp | relativeTime}}
      <md-tooltip md-delay="500"
                  md-autohide>
        [[Created at| Tooltip for the age column ]] {{::$ctrl.persistentVolumeClaim.objectMeta.creationTimestamp | date}}
      </md-tooltip>
    </kd-resource-card-column>
    <kd-resource-card-column class="kd-row-layout-column kd-icon-column">
      <kd-resource-card-menu>
        <kd-resource-card-delete-menu-item resource-kind-name="[[Persistent Volume Claim|Label 'Persistent Volume Claim' which will appear in the persistent volume claim delete dialog opened from a persistentvolumeclaim card on the list page.]]">
        </kd-resource-card-delete-menu-item>
        <kd-resource-card-edit-menu-item resource-kind-name="[[Persistent Volume Claim|Label 'Persistent Volume Claim' which will appear in the persistent volume claim edit dialog opened from a persistentvolumeclaim card on the list page.]]">
        </kd-resource-card-edit-menu-item>
      </kd-resource-card-menu>
    </kd-resource-card-column>
  </kd-resource-card-columns>
</kd-resource-card>
